import Vue from 'vue'

import Cookies from 'js-cookie'

import 'normalize.css/normalize.css' // CSS重置的现代替代方案

import Element from 'element-ui'
import './styles/element-variables.scss'
import 'element-ui/lib/theme-chalk/index.css'

import '@/styles/index.scss' // 全局CSS

import '@/common/Message' // 消息提示模块

import App from './App'
import store from './store'
import router from './router'

import './icons' // 图标
import './permission'

import './assets/icon/iconfont.css'

import axios from 'axios'

import { message } from '@/common/Message'

Vue.use(Element, {
  size: Cookies.get('size') || 'small' // 设置元素UI默认大小
})

Vue.prototype.$errorMsg = message.error
Vue.prototype.$warnMsg = message.warning
Vue.prototype.$successMsg = message.success

// 关闭警告
Vue.config.productionTip = false

axios.defaults.withCredentials = true

const setValues = require('../public/config')
Vue.prototype.BASE_URL = setValues.BASE_URL
axios.defaults.baseURL = setValues.BASE_URL + '/wsq-template/web'

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
